# -*- coding: utf-8 -*-
##---------------------------#
#                            #
#    Experiment Wizard       #
#    GUI classes             #
#                            #
#    by Jeroen Kools, 2011   #
#                            #
##---------------------------#

from PyQt4 import QtCore, QtGui 
from PyQt4.phonon import Phonon
import textwrap

try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    _fromUtf8 = lambda s: s
    
try:
    _encoding = QtGui.QApplication.UnicodeUTF8
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig)

    
class attributeEditorUi(object):
    def setupUi(self, editAttributeDialog):
        editAttributeDialog.setObjectName("editAttributeDialog")
        editAttributeDialog.resize(303, 175)
        self.buttonBox = QtGui.QDialogButtonBox(editAttributeDialog)
        self.buttonBox.setGeometry(QtCore.QRect(60, 140, 171, 32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.label = QtGui.QLabel(editAttributeDialog)
        self.label.setGeometry(QtCore.QRect(10, 7, 81, 30))
        self.label.setObjectName("label")
        self.attributeName = QtGui.QLineEdit(editAttributeDialog)
        self.attributeName.setGeometry(QtCore.QRect(130, 10, 161, 20))
        self.attributeName.setObjectName("attributeName")
        self.attributesText = QtGui.QTextEdit(editAttributeDialog)
        self.attributesText.setGeometry(QtCore.QRect(130, 40, 161, 91))
        self.attributesText.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
        self.attributesText.setObjectName("attributesText")
        self.label_2 = QtGui.QLabel(editAttributeDialog)
        self.label_2.setGeometry(QtCore.QRect(10, 38, 111, 91))
        self.label_2.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
        self.label_2.setWordWrap(True)
        self.label_2.setObjectName("label_2")

        self.retranslateUi(editAttributeDialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), editAttributeDialog.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), editAttributeDialog.reject)
        QtCore.QMetaObject.connectSlotsByName(editAttributeDialog)

    def retranslateUi(self, editAttributeDialog):
        editAttributeDialog.setWindowTitle(QtGui.QApplication.translate("editAttributeDialog", "Edit Attribute", None, QtGui.QApplication.UnicodeUTF8))
        self.label.setText(QtGui.QApplication.translate("editAttributeDialog", "Attribute name\n(e.g. Color)", None, QtGui.QApplication.UnicodeUTF8))
        self.label_2.setText(QtGui.QApplication.translate("editAttributeDialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:8pt;\">List the possible values for this attribute. </span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:8pt;\"><br />Separate values by commas or semicolons (e.g. red, blue, green)</span></p></body></html>", None, QtGui.QApplication.UnicodeUTF8))


# Defines the gui for the main window
#

class experimentWizardUi(object):
    def setupUi(self, dialog):
        dialog.setObjectName("dialog")
        dialog.resize(636, 553)
        dialog.setWindowTitle("BetaLab Experiment Wizard "+str(dialog.version))
        icons = Icons(dialog)
        dialog.setWindowIcon(icons.brainSmall)
        
        self.subjAttr_GroupBox = QtGui.QGroupBox(dialog)
        self.subjAttr_GroupBox.setGeometry(QtCore.QRect(10, 30, 191, 231))
        self.subjAttr_GroupBox.setObjectName("subjAttr_GroupBox")
        self.subjAttr_GroupBox.setToolTip("Relevant properties of your subjects\n"+\
                                          "E.g. sex, native language or age group")
        self.subjAttList = QtGui.QListWidget(self.subjAttr_GroupBox)
        self.subjAttList.setGeometry(QtCore.QRect(10, 20, 171, 171))
        self.subjAttList.setObjectName("subjAttList")
        self.subjAttAddButton = QtGui.QPushButton(self.subjAttr_GroupBox)
        self.subjAttAddButton.setGeometry(QtCore.QRect(20, 200, 71, 23))
        self.subjAttAddButton.setAcceptDrops(False)
        self.subjAttAddButton.setCheckable(False)
        self.subjAttAddButton.setChecked(False)
        self.subjAttAddButton.setDefault(False)
        self.subjAttAddButton.setFlat(False)
        self.subjAttAddButton.setObjectName("subjAttAddButton")
        self.subjAttRemoveButton = QtGui.QPushButton(self.subjAttr_GroupBox)
        self.subjAttRemoveButton.setGeometry(QtCore.QRect(100, 200, 71, 23))
        self.subjAttRemoveButton.setObjectName("subjAttRemoveButton")
        self.stimulusGroupBox = QtGui.QGroupBox(dialog)
        self.stimulusGroupBox.setGeometry(QtCore.QRect(210, 30, 201, 361))
        self.stimulusGroupBox.setObjectName("stimulusGroupBox")
        self.stimulusList = QtGui.QListWidget(self.stimulusGroupBox)
        self.stimulusList.setGeometry(QtCore.QRect(10, 20, 181, 261))
        self.stimulusList.setObjectName("stimulusList")
        self.stimAddButton = QtGui.QPushButton(self.stimulusGroupBox)
        self.stimAddButton.setGeometry(QtCore.QRect(20, 320, 75, 23))
        self.stimAddButton.setObjectName("stimAddButton")
        self.stimEditButton = QtGui.QPushButton(self.stimulusGroupBox)
        self.stimEditButton.setEnabled(False)
        self.stimEditButton.setGeometry(QtCore.QRect(20, 290, 75, 23))
        self.stimEditButton.setObjectName("stimEditButton")
        self.stimDeleteButton = QtGui.QPushButton(self.stimulusGroupBox)
        self.stimDeleteButton.setGeometry(QtCore.QRect(100, 320, 81, 23))
        self.stimDeleteButton.setObjectName("stimDeleteButton")
        self.stimUpButton = QtGui.QPushButton(self.stimulusGroupBox)
        self.stimUpButton.setGeometry(QtCore.QRect(110, 290, 31, 23))
        self.stimUpButton.setObjectName("stimUpButton")
        self.stimDownButton = QtGui.QPushButton(self.stimulusGroupBox)
        self.stimDownButton.setGeometry(QtCore.QRect(140, 290, 31, 23))
        self.stimDownButton.setObjectName("stimDownButton")
        # TODO: stimulus shuffle button
        self.stimAttr_GroupBox = QtGui.QGroupBox(dialog)
        self.stimAttr_GroupBox.setGeometry(QtCore.QRect(10, 270, 191, 231))
        self.stimAttr_GroupBox.setObjectName("stimAttr_GroupBox")
        self.stimAttr_GroupBox.setToolTip("Relevant properties of the stimuli\n"+\
                                          "E.g. color, mood, type, category")
        self.stimAttList = QtGui.QListWidget(self.stimAttr_GroupBox)
        self.stimAttList.setGeometry(QtCore.QRect(10, 20, 171, 171))
        self.stimAttList.setObjectName("stimAttList")
        self.stimAttAddButton = QtGui.QPushButton(self.stimAttr_GroupBox)
        self.stimAttAddButton.setGeometry(QtCore.QRect(20, 200, 71, 23))
        self.stimAttAddButton.setObjectName("stimAttAddButton")
        self.stimAttRemoveButton = QtGui.QPushButton(self.stimAttr_GroupBox)
        self.stimAttRemoveButton.setGeometry(QtCore.QRect(100, 200, 71, 23))
        self.stimAttRemoveButton.setObjectName("stimAttRemoveButton")
        self.subject_groupBox = QtGui.QGroupBox(dialog)
        self.subject_groupBox.setGeometry(QtCore.QRect(420, 30, 201, 361))
        self.subject_groupBox.setObjectName("subject_groupBox")
        self.subjectList = QtGui.QListWidget(self.subject_groupBox)
        self.subjectList.setGeometry(QtCore.QRect(10, 20, 181, 261))
        self.subjectList.setObjectName("subjectList")
        self.subjAddButton = QtGui.QPushButton(self.subject_groupBox)
        self.subjAddButton.setGeometry(QtCore.QRect(20, 320, 75, 23))
        self.subjAddButton.setObjectName("subjAddButton")
        self.subjDeleteButton = QtGui.QPushButton(self.subject_groupBox)
        self.subjDeleteButton.setGeometry(QtCore.QRect(100, 320, 81, 23))
        self.subjDeleteButton.setObjectName("subjDeleteButton")
        self.subjEditButton = QtGui.QPushButton(self.subject_groupBox)
        self.subjEditButton.setEnabled(False)
        self.subjEditButton.setGeometry(QtCore.QRect(20, 290, 75, 23))
        self.subjEditButton.setCheckable(False)
        self.subjEditButton.setChecked(False)
        self.subjEditButton.setDefault(False)
        self.subjEditButton.setFlat(False)
        self.subjEditButton.setObjectName("subjEditButton")
        self.subjDownButton = QtGui.QPushButton(self.subject_groupBox)
        self.subjDownButton.setGeometry(QtCore.QRect(140, 290, 31, 23))
        self.subjDownButton.setObjectName("subjDownButton")
        self.subjUpButton = QtGui.QPushButton(self.subject_groupBox)
        self.subjUpButton.setGeometry(QtCore.QRect(110, 290, 31, 23))
        self.subjUpButton.setObjectName("subjUpButton")
        self.groupBox_5 = QtGui.QGroupBox(dialog)
        self.groupBox_5.setGeometry(QtCore.QRect(210, 390, 411, 111))
        self.groupBox_5.setObjectName("groupBox_5")
        self.durationSpinbox = QtGui.QDoubleSpinBox(self.groupBox_5)
        self.durationSpinbox.setGeometry(QtCore.QRect(140, 20, 62, 22))
        self.durationSpinbox.setDecimals(3)
        self.durationSpinbox.setMinimum(0.01)
        self.durationSpinbox.setMaximum(60.0)
        self.durationSpinbox.setSingleStep(0.001)
        self.durationSpinbox.setProperty("value", 5.0)
        self.durationSpinbox.setObjectName("durationSpinbox")
        self.durationSpinbox.setToolTip("How long to display individual images\n"+
                                        "OR the length of the segments in which audio/video stimuli are split up")
        self.label = QtGui.QLabel(self.groupBox_5)
        self.label.setGeometry(QtCore.QRect(10, 20, 101, 21))
        self.label.setObjectName("label")
        self.intervalSpinbox = QtGui.QDoubleSpinBox(self.groupBox_5)
        self.intervalSpinbox.setGeometry(QtCore.QRect(140, 50, 62, 22))
        self.intervalSpinbox.setDecimals(3)
        self.intervalSpinbox.setMaximum(60.0)
        self.intervalSpinbox.setSingleStep(0.001)
        self.intervalSpinbox.setProperty("value", 1.0)
        self.intervalSpinbox.setObjectName("intervalSpinbox")
        self.label_2 = QtGui.QLabel(self.groupBox_5)
        self.label_2.setGeometry(QtCore.QRect(10, 50, 131, 21))
        self.label_2.setObjectName("label_2")
        self.randomizeCheckBox = QtGui.QCheckBox(self.groupBox_5)
        self.randomizeCheckBox.setGeometry(QtCore.QRect(220, 50, 171, 17))
        self.randomizeCheckBox.setObjectName("randomizeCheckBox")
                
        self.recordKeysCheckBox = QtGui.QCheckBox(self.groupBox_5)
        self.recordKeysCheckBox.setGeometry(QtCore.QRect(220, 22, 171, 17))
        self.recordKeysCheckBox.setObjectName("recordKeysCheckBox")
        
        self.backgroundColorComboBox = QtGui.QComboBox(self.groupBox_5)
        self.backgroundColorComboBox.setGeometry(QtCore.QRect(140, 80, 62, 22))
        self.backgroundColorComboBox.setObjectName("backgroundColorComboBox")
        self.backgroundColorComboBox.addItem("")
        self.backgroundColorComboBox.addItem("")
        self.backgroundColorComboBox.addItem("")
        self.backgroundColorComboBox.addItem("")
        self.BGColorLabel = QtGui.QLabel(self.groupBox_5)
        self.BGColorLabel.setGeometry(QtCore.QRect(10, 80, 101, 21))
        self.BGColorLabel.setObjectName("BGColorLabel")
        self.lastUntilSpaceCheckBox = QtGui.QCheckBox(self.groupBox_5)
        self.lastUntilSpaceCheckBox.setGeometry(QtCore.QRect(220, 80, 181, 17))
        self.lastUntilSpaceCheckBox.setChecked(False)
        self.lastUntilSpaceCheckBox.setObjectName("lastUntilSpaceCheckBox")
        self.recordButton = QtGui.QPushButton(dialog)
        self.recordButton.setGeometry(QtCore.QRect(300, 510, 75, 23))
        font = QtGui.QFont()
        font.setWeight(75)
        font.setItalic(False)
        font.setUnderline(False)
        font.setBold(True)
        self.recordButton.setFont(font)
        self.recordButton.setText("Record")
        self.recordButton.setCheckable(False)
        self.recordButton.setDefault(True)
        self.recordButton.setFlat(False)
        self.recordButton.setObjectName("recordButton")
        self.saveButton = QtGui.QPushButton(dialog)
        self.saveButton.setGeometry(QtCore.QRect(380, 510, 75, 23))
        font = QtGui.QFont()
        font.setWeight(50)
        font.setItalic(False)
        font.setUnderline(False)
        font.setBold(False)
        self.saveButton.setFont(font)
        self.saveButton.setText("Save")
        self.saveButton.setCheckable(False)
        self.saveButton.setDefault(False)
        self.saveButton.setFlat(False)
        self.saveButton.setObjectName("saveButton")
        self.loadButton = QtGui.QPushButton(dialog)
        self.loadButton.setGeometry(QtCore.QRect(460, 510, 75, 23))
        font = QtGui.QFont()
        font.setWeight(50)
        font.setItalic(False)
        font.setUnderline(False)
        font.setBold(False)
        self.loadButton.setFont(font)
        self.loadButton.setText("Load")
        self.loadButton.setCheckable(False)
        self.loadButton.setDefault(False)
        self.loadButton.setFlat(False)
        self.loadButton.setObjectName("loadButton")
        self.exitButton = QtGui.QPushButton(dialog)
        self.exitButton.setGeometry(QtCore.QRect(540, 510, 75, 23))
        font = QtGui.QFont()
        font.setWeight(50)
        font.setItalic(False)
        font.setUnderline(False)
        font.setBold(False)
        self.exitButton.setFont(font)
        self.exitButton.setText("Exit")
        self.exitButton.setCheckable(False)
        self.exitButton.setDefault(False)
        self.exitButton.setFlat(False)
        self.exitButton.setObjectName("exitButton")

        self.retranslateUi(dialog)
        QtCore.QObject.connect(self.lastUntilSpaceCheckBox, QtCore.SIGNAL("toggled(bool)"), self.durationSpinbox.setDisabled)
        QtCore.QObject.connect(self.randomizeCheckBox, QtCore.SIGNAL("toggled(bool)"), self.stimUpButton.setDisabled)
        QtCore.QObject.connect(self.randomizeCheckBox, QtCore.SIGNAL("toggled(bool)"), self.stimDownButton.setDisabled)
        QtCore.QMetaObject.connectSlotsByName(dialog)
        dialog.setTabOrder(self.subjAttList, self.subjAttAddButton)
        dialog.setTabOrder(self.subjAttAddButton, self.subjAttRemoveButton)
        dialog.setTabOrder(self.subjAttRemoveButton, self.stimAttList)
        dialog.setTabOrder(self.stimAttList, self.stimAttAddButton)
        dialog.setTabOrder(self.stimAttAddButton, self.stimAttRemoveButton)
        dialog.setTabOrder(self.stimAttRemoveButton, self.stimulusList)
        dialog.setTabOrder(self.stimulusList, self.stimEditButton)
        dialog.setTabOrder(self.stimEditButton, self.stimUpButton)
        dialog.setTabOrder(self.stimUpButton, self.stimDownButton)
        dialog.setTabOrder(self.stimDownButton, self.stimAddButton)
        dialog.setTabOrder(self.stimAddButton, self.stimDeleteButton)
        dialog.setTabOrder(self.stimDeleteButton, self.subjectList)
        dialog.setTabOrder(self.subjectList, self.subjEditButton)
        dialog.setTabOrder(self.subjEditButton, self.subjUpButton)
        dialog.setTabOrder(self.subjUpButton, self.subjDownButton)
        dialog.setTabOrder(self.subjDownButton, self.subjAddButton)
        dialog.setTabOrder(self.subjAddButton, self.subjDeleteButton)
        dialog.setTabOrder(self.subjDeleteButton, self.durationSpinbox)
        dialog.setTabOrder(self.durationSpinbox, self.intervalSpinbox)
        dialog.setTabOrder(self.intervalSpinbox, self.recordKeysCheckBox)
        dialog.setTabOrder(self.recordKeysCheckBox, self.backgroundColorComboBox)
        dialog.setTabOrder(self.backgroundColorComboBox, self.randomizeCheckBox)
                
        # menu bar
        menubar = dialog.menuBar()
        file = menubar.addMenu('&File')
        file.addAction(icons.newIcon,'&New', dialog.reset)
        file.addAction(icons.openIcon,'&Load experiment', dialog.loadExperiment)
        file.addAction(icons.saveIcon,'&Save experiment', dialog.saveExperiment)
        file.addSeparator()
        file.addAction(icons.exitIcon,'E&xit', dialog.exit)   
        
        tools = menubar.addMenu('&Tools')
        tools.addAction(icons.emotivIcon,'Start &Control Panel', dialog.controlPanel)
        tools.addAction(icons.emotivIcon,'Start &Testbench', dialog.testBench)
        tools.addSeparator()
        tools.addAction(icons.preferencesIcon,'&Settings', dialog.showSettings)
        
        help = menubar.addMenu('&Help') 
        help.addAction(icons.tutorialIcon,'&Online tutorial', dialog.tutorial) 
        help.addAction(icons.statsIcon,'&Usage statistics', dialog.showStats)
        help.addAction(icons.aboutIcon,'&About Experiment Wizard', dialog.about)

    def retranslateUi(self, dialog):
        self.subjAttr_GroupBox.setTitle(QtGui.QApplication.translate("dialog", "Subject Attributes", None, QtGui.QApplication.UnicodeUTF8))
        self.subjAttAddButton.setText(QtGui.QApplication.translate("dialog", "Add", None, QtGui.QApplication.UnicodeUTF8))
        self.subjAttRemoveButton.setText(QtGui.QApplication.translate("dialog", "Delete", None, QtGui.QApplication.UnicodeUTF8))
        self.stimulusGroupBox.setTitle(QtGui.QApplication.translate("dialog", "Stimuli", None, QtGui.QApplication.UnicodeUTF8))
        self.stimulusGroupBox.setToolTip("List of images, audio and video files to display")
        self.stimAddButton.setText(QtGui.QApplication.translate("dialog", "Add", None, QtGui.QApplication.UnicodeUTF8))
        self.stimEditButton.setText(QtGui.QApplication.translate("dialog", "Edit", None, QtGui.QApplication.UnicodeUTF8))
        self.stimDeleteButton.setText(QtGui.QApplication.translate("dialog", "Delete", None, QtGui.QApplication.UnicodeUTF8))
        self.stimUpButton.setText(QtGui.QApplication.translate("dialog", "▲", None, QtGui.QApplication.UnicodeUTF8))
        self.stimDownButton.setText(QtGui.QApplication.translate("dialog", "▼", None, QtGui.QApplication.UnicodeUTF8))
        self.stimAttr_GroupBox.setTitle(QtGui.QApplication.translate("dialog", "Stimulus Attributes", None, QtGui.QApplication.UnicodeUTF8))
        self.stimAttAddButton.setText(QtGui.QApplication.translate("dialog", "Add", None, QtGui.QApplication.UnicodeUTF8))
        self.stimAttRemoveButton.setText(QtGui.QApplication.translate("dialog", "Delete", None, QtGui.QApplication.UnicodeUTF8))
        self.subject_groupBox.setTitle(QtGui.QApplication.translate("dialog", "Subjects", None, QtGui.QApplication.UnicodeUTF8))
        self.subject_groupBox.setToolTip("List of people who kindly volunteered for the experiment!\nThe selected subject's name will automatically be used for\nthe output files")
        self.subjAddButton.setText(QtGui.QApplication.translate("dialog", "Add", None, QtGui.QApplication.UnicodeUTF8))
        self.subjDeleteButton.setText(QtGui.QApplication.translate("dialog", "Delete", None, QtGui.QApplication.UnicodeUTF8))
        self.subjEditButton.setText(QtGui.QApplication.translate("dialog", "Edit", None, QtGui.QApplication.UnicodeUTF8))
        self.subjDownButton.setText(QtGui.QApplication.translate("dialog", "▼", None, QtGui.QApplication.UnicodeUTF8))
        self.subjUpButton.setText(QtGui.QApplication.translate("dialog", "▲", None, QtGui.QApplication.UnicodeUTF8))
        self.groupBox_5.setTitle(QtGui.QApplication.translate("dialog", "Options", None, QtGui.QApplication.UnicodeUTF8))
        self.label.setText(QtGui.QApplication.translate("dialog", "Stimulus duration (s)", None, QtGui.QApplication.UnicodeUTF8))
        self.label_2.setText(QtGui.QApplication.translate("dialog", "Inter-stimulus interval (s)", None, QtGui.QApplication.UnicodeUTF8))
        self.randomizeCheckBox.setText(QtGui.QApplication.translate("dialog", "Randomize presentation order", None, QtGui.QApplication.UnicodeUTF8))
        self.backgroundColorComboBox.setItemText(0, QtGui.QApplication.translate("dialog", "Black", None, QtGui.QApplication.UnicodeUTF8))
        self.backgroundColorComboBox.setItemText(1, QtGui.QApplication.translate("dialog", "Grey", None, QtGui.QApplication.UnicodeUTF8))
        self.backgroundColorComboBox.setItemText(2, QtGui.QApplication.translate("dialog", "White", None, QtGui.QApplication.UnicodeUTF8))
        self.backgroundColorComboBox.setItemText(3, QtGui.QApplication.translate("dialog", "Magenta", None, QtGui.QApplication.UnicodeUTF8))
        self.backgroundColorComboBox.setToolTip("Use magenta background at your own peril")
        self.backgroundColorComboBox.setCurrentIndex(1)
        self.recordKeysCheckBox.setText(QtGui.QApplication.translate("dialog", "Record keystrokes", None, QtGui.QApplication.UnicodeUTF8))
        self.recordKeysCheckBox.setToolTip("Keypresses by the subject will be recorded and included in the output if checked")
        self.BGColorLabel.setText(QtGui.QApplication.translate("dialog", "Background color", None, QtGui.QApplication.UnicodeUTF8))
        self.lastUntilSpaceCheckBox.setText(QtGui.QApplication.translate("dialog", "Images last until [space] pressed", None, QtGui.QApplication.UnicodeUTF8))


class entityAdderUi(object):
    def setupUi(self, subjectAdder):
        subjectAdder.setObjectName("subjectAdder")
        subjectAdder.resize(301, 305)
        self.buttonBox = QtGui.QDialogButtonBox(subjectAdder)
        self.buttonBox.setGeometry(QtCore.QRect(70, 270, 171, 32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setCenterButtons(True)
        self.buttonBox.setObjectName("buttonBox")
        self.label = QtGui.QLabel(subjectAdder)
        self.label.setGeometry(QtCore.QRect(10, 10, 81, 21))
        self.label.setObjectName("label") 
        self.lineEdit = QtGui.QLineEdit(subjectAdder)
        self.lineEdit.setGeometry(QtCore.QRect(110, 10, 181, 20))
        self.lineEdit.setObjectName("lineEdit")
        self.lineEdit.setText("")
        self.scrollArea = QtGui.QScrollArea(subjectAdder)
        self.scrollArea.setGeometry(QtCore.QRect(10, 40, 281, 231))
        self.scrollArea.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
        self.scrollArea.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
        self.scrollArea.setWidgetResizable(True)
        self.scrollArea.setObjectName("scrollArea")
        self.scrollAreaWidgetContents = QtGui.QWidget(self.scrollArea)
        self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 262, 229))
        self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
        self.formLayoutWidget = QtGui.QWidget(self.scrollAreaWidgetContents)
        self.formLayoutWidget.setGeometry(QtCore.QRect(0, 0, 271, 231))
        self.formLayoutWidget.setObjectName("formLayoutWidget")
        self.formLayout = QtGui.QFormLayout(self.formLayoutWidget)
        self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
        self.formLayout.setObjectName("formLayout")
        self.scrollArea.setWidget(self.scrollAreaWidgetContents)
        self.openButton = QtGui.QPushButton(subjectAdder)
        self.openButton.setGeometry(QtCore.QRect(10, 10, 91, 20))
        icons = Icons()
        icon = icons.openIcon
        self.openButton.setIcon(icon)
        self.openButton.setObjectName("openButton")     

        self.retranslateUi(subjectAdder)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), subjectAdder.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), subjectAdder.reject)
        QtCore.QMetaObject.connectSlotsByName(subjectAdder)

    def retranslateUi(self, subjectAdder):
        subjectAdder.setWindowTitle(QtGui.QApplication.translate("subjectAdder", "Add Subject", None, QtGui.QApplication.UnicodeUTF8))
        self.label.setText(QtGui.QApplication.translate("subjectAdder", "Subject name", None, QtGui.QApplication.UnicodeUTF8))
        self.openButton.setText(QtGui.QApplication.translate("subjectAdder", "Select file...", None, QtGui.QApplication.UnicodeUTF8))

##--------------------------------------%%
##            slideshowUi               ##
##    for displaying visual stimuli     ##
##--------------------------------------#/

class slideshowUi(object):

    def setupUi(self):
        self.showFullScreen()
        self.fullScreen = True # might not be necessary
        self.disp = QtGui.QLabel("Initializing...", self)
        self.disp.setAlignment(QtCore.Qt.AlignCenter)
        self.disp.setFont(QtGui.QFont('Arial', 60)) # big letters
        self.disp.setWordWrap(True)
        self.disp.setCursor(QtCore.Qt.BlankCursor)
        #self.disp.setScaledContents(True)
        self.resolution = QtGui.QDesktopWidget().availableGeometry()
        self.layout = QtGui.QGridLayout(self)
        self.layout.addWidget(self.disp)
        
        self.label = self.disp
        self.vp = VideoPlayer(self)
                
##--------------------------------------%%
##            VideoPlayer               ##
##        Displays video stimuli        ##
##--------------------------------------#/

class VideoPlayer(Phonon.VideoPlayer):

    def __init__(self, parent=None):
        Phonon.VideoPlayer.__init__(self)
        self.connect(self, QtCore.SIGNAL("finished()"), self.quit)        
        self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
        #self.videoWidget().setFullScreen(1)
        self.videoWidget().setScaleMode(0)
        self.setFocus()
        self.setCursor(QtCore.Qt.BlankCursor)
        self.videoWidget().setCursor(QtCore.Qt.BlankCursor)
        self.parent = parent       
        QtGui.QShortcut(QtGui.QKeySequence("Space"), self,QtCore.SIGNAL("finished()"))
        #QtGui.QShortcut(QtGui.QKeySequence("Space"), self,self.space())
        #QtGui.QShortcut(QtGui.QKeySequence("Escape"), self,self.space())        
        
    # TODO: fix skipping
    def keyPressEvent(self, event):
        #print 'videoplayer keypressevent'
        self.parent.keyPressEvent(event) # pass on to slideshowDialog
        event.accept()
    
    def space(self): # skip movie, go to next stimulus
        #print 'videoplayer space'
        self.stop()
        
    def quit(self):
        #print 'videoplayer quit'        
        #print 'Finished playing AV stimulus'
        self.hide()
        
class about(QtGui.QDialog):
    def __init__(self):
        QtGui.QWidget.__init__(self,None)
        self.text = QtGui.QLabel(self)
        self.setWindowIcon(Icons().aboutIcon)
        w = 42
        about1 = "By Jeroen Kools 2010-2012"
        about2 = "\n\nSpecial thanks to Sennay Ghebreab, Dayan Garmaev, David de Bos and all ICC students for their patience, enthusiasm and feedback."
        about3 = "\n\nExperiment Wizard is freeware, released under GPL 3. See readme.txt for more info."
        aboutText = textwrap.fill(about1, w, replace_whitespace = False)+textwrap.fill(about2, w, replace_whitespace = False)+\
                    textwrap.fill(about3, w, replace_whitespace = False)
        self.text.setText(aboutText)
        self.text.setFixedSize(230, 170)
        self.text.setAlignment(QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
        self.setObjectName('About')
        self.setWindowTitle("About")
        self.text.setStyleSheet("QLabel{ padding:12px 4px; }" )
        
        self.ok = QtGui.QPushButton("OK",self)
        self.ok.setGeometry(95,138,40,24)
        QtCore.QObject.connect(self.ok, QtCore.SIGNAL("clicked()"), self.close )

class settingsUi(object):
    def setupUi(self, Settings):
        Settings.setObjectName(_fromUtf8("Settings"))
        Settings.resize(290, 329)
        self.buttonBox = QtGui.QDialogButtonBox(Settings)
        self.buttonBox.setGeometry(QtCore.QRect(-80, 290, 341, 32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.tabWidget = QtGui.QTabWidget(Settings)
        self.tabWidget.setGeometry(QtCore.QRect(10, 10, 271, 271))
        self.tabWidget.setObjectName(_fromUtf8("tabWidget"))
        self.tab = QtGui.QWidget()
        self.tab.setObjectName(_fromUtf8("tab"))
        self.generateARFFCheckBox = QtGui.QCheckBox(self.tab)
        self.generateARFFCheckBox.setGeometry(QtCore.QRect(20, 70, 101, 20))
        self.generateARFFCheckBox.setChecked(True)
        self.generateARFFCheckBox.setObjectName(_fromUtf8("generateARFFCheckBox"))
        self.comboBox = QtGui.QComboBox(self.tab)
        self.comboBox.setGeometry(QtCore.QRect(160, 40, 91, 20))
        self.comboBox.setObjectName(_fromUtf8("comboBox"))
        self.comboBox.addItem(_fromUtf8(""))
        self.comboBox.addItem(_fromUtf8(""))
        self.comboBox.addItem(_fromUtf8(""))
        self.generateCSVCheckBox = QtGui.QCheckBox(self.tab)
        self.generateCSVCheckBox.setGeometry(QtCore.QRect(20, 20, 91, 20))
        self.generateCSVCheckBox.setChecked(True)
        self.generateCSVCheckBox.setObjectName(_fromUtf8("generateCSVCheckBox"))
        self.label = QtGui.QLabel(self.tab)
        self.label.setGeometry(QtCore.QRect(40, 40, 101, 20))
        self.label.setObjectName(_fromUtf8("label"))
        self.lineEdit_2 = QtGui.QLineEdit(self.tab)
        self.lineEdit_2.setGeometry(QtCore.QRect(140, 140, 113, 20))
        self.lineEdit_2.setObjectName(_fromUtf8("lineEdit_2"))
        self.checkBox_3 = QtGui.QCheckBox(self.tab)
        self.checkBox_3.setEnabled(False)
        self.checkBox_3.setGeometry(QtCore.QRect(20, 110, 141, 20))
        self.checkBox_3.setObjectName(_fromUtf8("checkBox_3"))
        self.label_3 = QtGui.QLabel(self.tab)
        self.label_3.setGeometry(QtCore.QRect(20, 140, 81, 16))
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.label_2 = QtGui.QLabel(self.tab)
        self.label_2.setGeometry(QtCore.QRect(20, 170, 71, 16))
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.lineEdit = QtGui.QLineEdit(self.tab)
        self.lineEdit.setGeometry(QtCore.QRect(20, 190, 191, 20))
        self.lineEdit.setObjectName(_fromUtf8("lineEdit"))
        self.pushButton = QtGui.QPushButton(self.tab)
        self.pushButton.setGeometry(QtCore.QRect(220, 190, 31, 20))
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.saveRawEEGCheckBox = QtGui.QCheckBox(self.tab)
        self.saveRawEEGCheckBox.setGeometry(QtCore.QRect(20, 90, 131, 17))
        self.saveRawEEGCheckBox.setObjectName(_fromUtf8("saveRawEEGCheckBox"))
        self.tabWidget.addTab(self.tab, _fromUtf8(""))
        self.tab_2 = QtGui.QWidget()
        self.tab_2.setObjectName(_fromUtf8("tab_2"))
        self.pushButton_2 = QtGui.QPushButton(self.tab_2)
        self.pushButton_2.setGeometry(QtCore.QRect(220, 100, 31, 20))
        self.pushButton_2.setObjectName(_fromUtf8("pushButton_2"))
        self.label_4 = QtGui.QLabel(self.tab_2)
        self.label_4.setGeometry(QtCore.QRect(20, 50, 101, 20))
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.label_5 = QtGui.QLabel(self.tab_2)
        self.label_5.setGeometry(QtCore.QRect(20, 20, 131, 20))
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self.lineEdit_3 = QtGui.QLineEdit(self.tab_2)
        self.lineEdit_3.setGeometry(QtCore.QRect(20, 100, 191, 20))
        self.lineEdit_3.setObjectName(_fromUtf8("lineEdit_3"))
        self.comboBox_2 = QtGui.QComboBox(self.tab_2)
        self.comboBox_2.setGeometry(QtCore.QRect(150, 50, 101, 20))
        self.comboBox_2.setObjectName(_fromUtf8("comboBox_2"))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.checkBox_4 = QtGui.QCheckBox(self.tab_2)
        self.checkBox_4.setGeometry(QtCore.QRect(20, 130, 171, 20))
        self.checkBox_4.setObjectName(_fromUtf8("checkBox_4"))
        self.comboBox_3 = QtGui.QComboBox(self.tab_2)
        self.comboBox_3.setGeometry(QtCore.QRect(150, 20, 101, 20))
        self.comboBox_3.setObjectName(_fromUtf8("comboBox_3"))
        self.comboBox_3.addItem(_fromUtf8(""))
        self.comboBox_3.addItem(_fromUtf8(""))
        self.comboBox_3.addItem(_fromUtf8(""))
        self.label_6 = QtGui.QLabel(self.tab_2)
        self.label_6.setGeometry(QtCore.QRect(20, 80, 91, 20))
        self.label_6.setObjectName(_fromUtf8("label_6"))
        self.checkBox_5 = QtGui.QCheckBox(self.tab_2)
        self.checkBox_5.setGeometry(QtCore.QRect(20, 160, 171, 20))
        self.checkBox_5.setObjectName(_fromUtf8("checkBox_5"))
        self.tabWidget.addTab(self.tab_2, _fromUtf8(""))
        self.tab_3 = QtGui.QWidget()
        self.tab_3.setObjectName(_fromUtf8("tab_3"))
        self.label_7 = QtGui.QLabel(self.tab_3)
        self.label_7.setEnabled(False)
        self.label_7.setGeometry(QtCore.QRect(20, 50, 111, 20))
        self.label_7.setObjectName(_fromUtf8("label_7"))
        self.comboBox_4 = QtGui.QComboBox(self.tab_3)
        self.comboBox_4.setEnabled(False)
        self.comboBox_4.setGeometry(QtCore.QRect(150, 20, 101, 20))
        self.comboBox_4.setObjectName(_fromUtf8("comboBox_4"))
        self.comboBox_4.addItem(_fromUtf8(""))
        self.comboBox_4.addItem(_fromUtf8(""))
        self.comboBox_4.addItem(_fromUtf8(""))
        self.label_8 = QtGui.QLabel(self.tab_3)
        self.label_8.setEnabled(False)
        self.label_8.setGeometry(QtCore.QRect(20, 20, 101, 20))
        self.label_8.setObjectName(_fromUtf8("label_8"))
        self.comboBox_5 = QtGui.QComboBox(self.tab_3)
        self.comboBox_5.setEnabled(False)
        self.comboBox_5.setGeometry(QtCore.QRect(150, 50, 101, 20))
        self.comboBox_5.setObjectName(_fromUtf8("comboBox_5"))
        self.comboBox_5.addItem(_fromUtf8(""))
        self.comboBox_5.addItem(_fromUtf8(""))
        self.comboBox_5.addItem(_fromUtf8(""))
        self.tabWidget.addTab(self.tab_3, _fromUtf8(""))
        self.tab_4 = QtGui.QWidget()
        self.tab_4.setObjectName(_fromUtf8("tab_4"))
        self.label_9 = QtGui.QLabel(self.tab_4)
        self.label_9.setGeometry(QtCore.QRect(20, 50, 111, 20))
        self.label_9.setObjectName(_fromUtf8("label_9"))
        self.customizeBandsButton = QtGui.QToolButton(self.tab_4)
        self.customizeBandsButton.setEnabled(False)
        self.customizeBandsButton.setGeometry(QtCore.QRect(180, 50, 61, 20))
        self.customizeBandsButton.setObjectName(_fromUtf8("customizeBandsButton"))
        self.label_10 = QtGui.QLabel(self.tab_4)
        self.label_10.setGeometry(QtCore.QRect(20, 20, 161, 20))
        self.label_10.setObjectName(_fromUtf8("label_10"))
        self.spinBox = QtGui.QSpinBox(self.tab_4)
        self.spinBox.setGeometry(QtCore.QRect(180, 20, 61, 20))
        self.spinBox.setSingleStep(1)
        self.spinBox.setProperty("value", 3)
        self.spinBox.setObjectName(_fromUtf8("spinBox"))
        self.groupBox = QtGui.QGroupBox(self.tab_4)
        self.groupBox.setGeometry(QtCore.QRect(20, 120, 121, 81))
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.eyetrackCheckBox = QtGui.QCheckBox(self.groupBox)
        self.eyetrackCheckBox.setEnabled(False)
        self.eyetrackCheckBox.setGeometry(QtCore.QRect(20, 50, 70, 17))
        self.eyetrackCheckBox.setObjectName(_fromUtf8("eyetrackCheckBox"))
        self.calibrateButton = QtGui.QPushButton(self.groupBox)
        self.calibrateButton.setGeometry(QtCore.QRect(20, 20, 61, 21))
        self.calibrateButton.setObjectName(_fromUtf8("calibrateButton"))
        self.wallTimeCheckBox = QtGui.QCheckBox(self.tab_4)
        self.wallTimeCheckBox.setGeometry(QtCore.QRect(227, 80, 21, 20))
        self.wallTimeCheckBox.setText(_fromUtf8(""))
        self.wallTimeCheckBox.setObjectName(_fromUtf8("wallTimeCheckBox"))
        self.label_11 = QtGui.QLabel(self.tab_4)
        self.label_11.setGeometry(QtCore.QRect(20, 80, 201, 31))
        self.label_11.setTextFormat(QtCore.Qt.PlainText)
        self.label_11.setScaledContents(False)
        self.label_11.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
        self.label_11.setWordWrap(True)
        self.label_11.setObjectName(_fromUtf8("label_11"))
        self.tabWidget.addTab(self.tab_4, _fromUtf8(""))

        self.retranslateUi(Settings)
        self.tabWidget.setCurrentIndex(0)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Settings.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Settings.reject)
        QtCore.QObject.connect(self.calibrateButton, QtCore.SIGNAL(_fromUtf8("clicked()")), Settings.calibrate)
        QtCore.QObject.connect(self.pushButton_2, QtCore.SIGNAL(_fromUtf8("clicked()")), Settings.setMaskFolder)
        QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL(_fromUtf8("clicked()")), Settings.setOutputFolder)
        QtCore.QMetaObject.connectSlotsByName(Settings)

    def retranslateUi(self, Settings):
        Settings.setWindowTitle(_translate("Settings", "Settings", None))
        self.generateARFFCheckBox.setText(_translate("Settings", "Generate ARFF", None))
        self.comboBox.setItemText(0, _translate("Settings", "Semicolon", None))
        self.comboBox.setItemText(1, _translate("Settings", "Comma", None))
        self.comboBox.setItemText(2, _translate("Settings", "Tab", None))
        self.generateCSVCheckBox.setText(_translate("Settings", "Generate CSV", None))
        self.label.setText(_translate("Settings", "CSV separator", None))
        self.lineEdit_2.setToolTip(_translate("Settings", "e.g. \'MemoryTest\' or \'Team B\'", None))
        self.checkBox_3.setToolTip(_translate("Settings", "To be included some day...", None))
        self.checkBox_3.setText(_translate("Settings", "Generate spectrograms", None))
        self.label_3.setText(_translate("Settings", "Filename prefix", None))
        self.label_2.setText(_translate("Settings", "Output folder", None))
        self.pushButton.setText(_translate("Settings", "...", None))
        self.saveRawEEGCheckBox.setText(_translate("Settings", "Save raw EEG", None))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("Settings", "Output", None))
        self.pushButton_2.setText(_translate("Settings", "...", None))
        self.label_4.setText(_translate("Settings", "Mask length", None))
        self.label_5.setText(_translate("Settings", "Masking stimuli for images", None))
        self.comboBox_2.setItemText(0, _translate("Settings", "Until <space>", None))
        self.comboBox_2.setItemText(1, _translate("Settings", "0.5 seconds", None))
        self.comboBox_2.setItemText(2, _translate("Settings", "1 second", None))
        self.comboBox_2.setItemText(3, _translate("Settings", "2 seconds", None))
        self.comboBox_2.setItemText(4, _translate("Settings", "3 seconds", None))
        self.comboBox_2.setItemText(5, _translate("Settings", "5 seconds", None))
        self.checkBox_4.setText(_translate("Settings", "Save keypresses during masks", None))
        self.comboBox_3.setItemText(0, _translate("Settings", "None", None))
        self.comboBox_3.setItemText(1, _translate("Settings", "Forward", None))
        self.comboBox_3.setItemText(2, _translate("Settings", "Backward", None))
        self.label_6.setText(_translate("Settings", "Mask image folder", None))
        self.checkBox_5.setText(_translate("Settings", "Randomize mask order", None))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("Settings", "Masking", None))
        self.label_7.setText(_translate("Settings", "Noise/artifact removal", None))
        self.comboBox_4.setToolTip(_translate("Settings", "Other options to be implemented", None))
        self.comboBox_4.setItemText(0, _translate("Settings", "Fourier", None))
        self.comboBox_4.setItemText(1, _translate("Settings", "Haar wavelets", None))
        self.comboBox_4.setItemText(2, _translate("Settings", "Morlet wavelets", None))
        self.label_8.setText(_translate("Settings", "Wave decomposition", None))
        self.comboBox_5.setToolTip(_translate("Settings", "Other options to be implemented", None))
        self.comboBox_5.setItemText(0, _translate("Settings", "EPOC\'s only", None))
        self.comboBox_5.setItemText(1, _translate("Settings", "Medium", None))
        self.comboBox_5.setItemText(2, _translate("Settings", "Maximum", None))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("Settings", "Processing", None))
        self.label_9.setText(_translate("Settings", "Wavebands", None))
        self.customizeBandsButton.setToolTip(_translate("Settings", "To be implemented", None))
        self.customizeBandsButton.setText(_translate("Settings", "Customize", None))
        self.label_10.setText(_translate("Settings", "Countdown starts at", None))
        self.groupBox.setTitle(_translate("Settings", "Eye Tracking", None))
        self.eyetrackCheckBox.setText(_translate("Settings", "Enable", None))
        self.calibrateButton.setText(_translate("Settings", "Calibrate", None))
        self.label_11.setText(_translate("Settings", "Record walltime instead of stimulus onset time for responses", None))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), _translate("Settings", "Misc", None))


class statsUi(object):
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(262, 193)
        Dialog.setWindowIcon(Icons().statsIcon)
        self.pushButton = QtGui.QPushButton(Dialog)
        self.pushButton.setGeometry(QtCore.QRect(180, 160, 75, 23))
        self.pushButton.setObjectName("pushButton")
        self.label = QtGui.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(20, 10, 251, 21))
        self.label_2 = QtGui.QLabel(Dialog)
        self.label_2.setGeometry(QtCore.QRect(20, 40, 251, 21))
        self.label_3 = QtGui.QLabel(Dialog)
        self.label_3.setGeometry(QtCore.QRect(20, 70, 251, 21))
        self.label_4 = QtGui.QLabel(Dialog)
        self.label_4.setGeometry(QtCore.QRect(20, 100, 251, 21))

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL("clicked()"), Dialog.accept)
        QtCore.QMetaObject.connectSlotsByName(Dialog)

    def retranslateUi(self, Dialog):
        Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
        self.pushButton.setText(QtGui.QApplication.translate("Dialog", "OK", None, QtGui.QApplication.UnicodeUTF8))
        self.label.setText(QtGui.QApplication.translate("Dialog", "Experiments run:", None, QtGui.QApplication.UnicodeUTF8))
        self.label_2.setText(QtGui.QApplication.translate("Dialog", "Stimuli displayed:", None, QtGui.QApplication.UnicodeUTF8))
        self.label_3.setText(QtGui.QApplication.translate("Dialog", "Installed:", None, QtGui.QApplication.UnicodeUTF8))
        self.label_4.setText(QtGui.QApplication.translate("Dialog", "Total running time:", None, QtGui.QApplication.UnicodeUTF8))
        
class recordTimeUi(object):
    def setupUi(self, RecordTimeDialog):
        RecordTimeDialog.setObjectName(_fromUtf8("RecordTimeDialog"))
        RecordTimeDialog.resize(367, 187)
        RecordTimeDialog.setWindowTitle(QtGui.QApplication.translate("RecordTimeDialog", "Experiment Wizard", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonBox = QtGui.QDialogButtonBox(RecordTimeDialog)
        self.buttonBox.setGeometry(QtCore.QRect(20, 150, 331, 32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.label = QtGui.QLabel(RecordTimeDialog)
        self.label.setGeometry(QtCore.QRect(10, 10, 351, 61))
        self.label.setText(QtGui.QApplication.translate("RecordTimeDialog", "You did not list any stimuli for this experiment. If you want to make a recording anyway (e.g. if you present stimuli outside Experiment Wizard), please enter the desired recording duration below.", None, QtGui.QApplication.UnicodeUTF8))
        self.label.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter)
        self.label.setWordWrap(True)
        self.label.setMargin(6)
        self.label.setObjectName(_fromUtf8("label"))
        self.label_3 = QtGui.QLabel(RecordTimeDialog)
        self.label_3.setGeometry(QtCore.QRect(90, 80, 81, 21))
        self.label_3.setText(QtGui.QApplication.translate("RecordTimeDialog", "Minutes", None, QtGui.QApplication.UnicodeUTF8))
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.minuteSpinBox = QtGui.QSpinBox(RecordTimeDialog)
        self.minuteSpinBox.setGeometry(QtCore.QRect(30, 80, 51, 22))
        self.minuteSpinBox.setMaximum(300)
        self.minuteSpinBox.setObjectName(_fromUtf8("minuteSpinBox"))
        self.secondsSpinBox = QtGui.QSpinBox(RecordTimeDialog)
        self.secondsSpinBox.setGeometry(QtCore.QRect(30, 110, 51, 22))
        self.secondsSpinBox.setMaximum(59)
        self.secondsSpinBox.setObjectName(_fromUtf8("secondsSpinBox"))
        self.label_4 = QtGui.QLabel(RecordTimeDialog)
        self.label_4.setGeometry(QtCore.QRect(90, 110, 81, 21))
        self.label_4.setText(QtGui.QApplication.translate("RecordTimeDialog", "Seconds", None, QtGui.QApplication.UnicodeUTF8))
        self.label_4.setObjectName(_fromUtf8("label_4"))

        self.retranslateUi(RecordTimeDialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), RecordTimeDialog.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), RecordTimeDialog.reject)
        QtCore.QMetaObject.connectSlotsByName(RecordTimeDialog)

    def retranslateUi(self, RecordTimeDialog):
        pass

class Icons(object):
    def __init__(self, parent = None):
        self.brainSmall = self.makeIcon("icon_brain16.ico")
        self.brainMed = self.makeIcon("icon_brain32.ico")
        self.brainBig = self.makeIcon("icon_brain64.ico")
        
        self.openIcon = self.makeIcon("OpenIcon.png")
        self.newIcon = self.makeIcon("newfile.png")
        self.saveIcon = self.makeIcon("save_icon.gif")
        self.exitIcon = self.makeIcon("exit.png")
        
        self.emotivIcon = self.makeIcon("emotiv.png")
        self.tutorialIcon = self.makeIcon("tutorial.gif")
        self.statsIcon = self.makeIcon("stats.png")
        self.aboutIcon = self.makeIcon("question_mark.png")
        self.advancedIcon = self.makeIcon("advanced.png")
        self.preferencesIcon = self.makeIcon("preferences.gif")
        self.wrenchIcon = self.makeIcon("wrench.gif")
    
    def makeIcon(self,imagefile):
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("images\\"+imagefile), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        return icon